<template>
	<div>
		<el-card class="box-card" style="height: 80px">
			<p class="fl">
				<el-date-picker
			      v-model="dates"
			      type="daterange"
			      align="right"
			      unlink-panels
			      range-separator="至"
			      start-placeholder="开始日期"
			      end-placeholder="结束日期"
			      @change="get_dataList"
			      :picker-options="pickerOptions2">
			    </el-date-picker>
			</p>
			<p class="fr">
				<el-input v-model="search_key" placeholder="可输入订单号，买家卖家信息" class="w200"></el-input>
				<el-button type="primary" @click="get_dataList">搜索</el-button>
			</p>
		</el-card>
		<sy-pages :dataList="dataList" :toClick="get_dataList"></sy-pages>
	</div>

	
</template>

<script>
import axios from 'axios'
export default{
	data (){
		return {
			dataList: this.$store.state.dataList
		}
	},
	methods: {
		//获取数据列表
		get_dataList(pageNo, pageSize){
			let params = {
					shopName: this.shopName,
					date: this.dates ? moment(this.dates).format('YYYY-MM-DD') : '',
					pageNo: typeof pageNo == Number ? pageNo : 1,
					pageSize: pageSize || this.dataList.page.pageSize || 20
				}
			
			axios.post($base + 'dataList/getGnmjbaList', params).then(json => {
				this.dataList = json.data;
			}).catch(err => {
				console.log(err);
			})
		},
	},
	mounted(){
		this.get_dataList();
	}
}
	
</script>